VERSION 5.00
Begin VB.Form FrmPrincipal 
   Caption         =   "Generando Planilla......"
   ClientHeight    =   816
   ClientLeft      =   60
   ClientTop       =   456
   ClientWidth     =   6612
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   816
   ScaleWidth      =   6612
   StartUpPosition =   2  'CenterScreen
   Begin VB.Timer Timer1 
      Left            =   1080
      Top             =   120
   End
   Begin VB.Frame Frame2 
      Caption         =   "Estado:  "
      Height          =   615
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   6375
      Begin VB.PictureBox Picture1 
         Appearance      =   0  'Flat
         ForeColor       =   &H00FF0000&
         Height          =   255
         Left            =   120
         ScaleHeight     =   228
         ScaleWidth      =   6108
         TabIndex        =   1
         Top             =   240
         Width           =   6135
      End
   End
End
Attribute VB_Name = "FrmPrincipal"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private unidad As Long
Private limite As Long
Private Progreso As Long
Private defProgBarHwnd  As Long
Private Detener As Boolean
Private Sub Command1_Click()
    Dim i As Long
    Picture1.DrawMode = 10
    Picture1.FillStyle = 0
    unidad = 1
    limite = 50
    Progreso = 1
    Timer1.Interval = 150
End Sub

Private Sub MostrarPorcentaje(limite As Long, Progreso As Long)

    Dim msg As String
    If Progreso <= limite Then
      If Progreso > Picture1.ScaleWidth Then
         Progreso = Picture1.ScaleWidth
      End If
      Picture1.Cls
      Picture1.ScaleWidth = limite
      msg = Format$(CLng((Progreso / Picture1.ScaleWidth) * 100)) + "%"
      Picture1.CurrentX = (Picture1.ScaleWidth - Picture1.TextWidth(msg)) \ 2
      Picture1.CurrentY = (Picture1.ScaleHeight - Picture1.TextHeight(msg)) \ 2
      Picture1.Print msg
      Picture1.Line (0, 0)-(Progreso, Picture1.ScaleHeight), Picture1.ForeColor, BF
      DoEvents
    End If
    
End Sub

Private Sub Form_Load()
     Command1_Click
     
End Sub

Private Sub Option1_Click()
    'Picture1.BackColor = &H8000000F
End Sub

Private Sub Timer1_Timer()
 
  
   Progreso = Progreso + unidad
   MostrarPorcentaje limite, Progreso
    If Progreso >= limite Then
     Timer1.Interval = 0
     Unload Me
    End If
    
    
End Sub


